<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组的遍历</title>
</head>
<body>
    <script>
        // var arr = [1,2,3,4,5,6]
        var arr = new Array(6);
        arr[1] = 2;
        arr[3] = 4;
        arr[5] = 6;
        // 常规方面for
        for(var i=0 ; i<arr.length;i++){
            document.write(arr[i]+'<br>')
        }
        //  fon in 遍历
        for(var i in arr){
            console.log(arr[i])
        }

        // fon of 遍历
        for(var i of arr){
            console.log(i)
        }

    </script>
</body>
</html>